import { TagsItem } from '@/api/tags';
import { Input } from 'antd';
import FormItem from 'antd/es/form/FormItem';
import React, { useEffect } from 'react';

interface Props {
  data?: TagsItem;
  form: any;
}

export default function EditForm({ data, form }: Props) {
  useEffect(() => {
    if (form) {
      form.setFieldsValue({
        _id: data?._id,
        tagName: data?.tagName
      });
    }
  }, [data]);
  return (
    <>
      <FormItem labelCol={{ span: 3 }} label="id" name="_id" initialValue={data?._id}>
        {data?._id}
      </FormItem>
      <FormItem labelCol={{ span: 3 }} label="标签" name="tagName" required>
        <Input placeholder="请输入标签" allowClear />
      </FormItem>
    </>
  );
}
